package com.zhiyou100.video.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.zhiyou100.video.mapper.CourseMapper;
import com.zhiyou100.video.model.Course;
import com.zhiyou100.video.service.CourseService;

@Service
@Transactional
public class CourseServiceImpl implements CourseService {

	@Autowired
	private CourseMapper courseMapper;

	@Override
	public List<Course> selectByVideo() {
		return courseMapper.selectByVideo();
	}

	@Override
	public List<Course> selectCourse() {
		return courseMapper.selectCourse();
	}

	@Override
	public List<Course> selectAll() {
		return courseMapper.selectAll();
	}

	@Override
	public int insertCourse(Course course) {
		return courseMapper.insertCourse(course);
	}
	
	@Override
	public Course selectById(int id) {
		return courseMapper.selectById(id);
	}

	@Override
	public int updateCourse(Course course) {
		return courseMapper.updateCourse(course);
	}

	@Override
	public int deleteById(int id) {
		return courseMapper.deleteById(id);
	}

	@Override
	public List<Course> selectBySubjectId(int subject_id) {
		return courseMapper.selectBySubjectId(subject_id);
	}


}